<template>
	<view class="msglist">
		<view class="title">{{initData.title}}</view>
		<view class="msg">
			<rich-text :nodes="initData.content"></rich-text>
		</view>


	</view>
</template>
<script>
	import {
		uniIcons
	} from '@dcloudio/uni-ui';
	import help from '../../../servers/my/help.js';
	export default {
		data() {
			return {
				initData: '',
				obj: {},
				id: ''
			};

		},
		onLoad(option) {
			if (option.obj) {
				this.obj = JSON.parse(option.obj)
			}
			this.id = option.id;
		},
		mounted() {
			this.getData()

		},

		methods: {
			getData() {

				help.findListByType(this.obj)
					.then(res => {
						if (res.code == 200) {
							for (var i = 0; i < res.data.records.length; i++)
								if (this.id == res.data.records[i].id) {
									this.initData = res.data.records[i]
								}

						} else {
							uni.showToast({
								title: res.msg,
								icon: 'none'
							});
						}
					})
					.catch(err => {
						console.log(new Error('请检查网络后重试'));
					});
			},
		}
	};
</script>

<style lang="less" scoped>
	page {
		background: #ffffff;
	}

	.msglist {
		padding: 30rpx;
		.title{
			margin-bottom: 30rpx;
		}
		
	}
</style>
